$(document).ready(function(){
	$('.nav').click(function(){
		nav_switch(this.value,'1');
	});
});
function nav_switch(n,pager){
	switch(n){
		case 1:
			$("#page-wrapper").load("./teacher_info.php",{pager:pager});
			break;
		case 2:
			$("#page-wrapper").load("./student_info.php",{pager:pager});
			break;
		case 3:
			$("#page-wrapper").load("./course_info.php",{pager:pager});
			break;
		case 4:
			$("#page-wrapper").load("./choice_info.php",{pager:pager});
			break;
		case 5:
			$("#page-wrapper").load("./sign_info.php",{pager:pager});
			break;
		case 6:
			$("#page-wrapper").load("./card_info.php",{pager:pager});
			break;
		case 7:
			$("#page-wrapper").load("./date_info.php");
			break;
		case 0:
			$("#page-wrapper").load("./info_count.php");
			break;
		default:
			$("#page-wrapper").load("./info_count.php");
			break;
	}
}
function up(){
	$("#box_bg").css({'height':$(document).height(),'width':$(document).width()});
	var height = ($(window).height()-$("#box").height())/3;
	var width = ($(window).width()-$("#box").width())/3;
	$("#box").css({'top':height,'left':width});
	$('#box_bg').show();
}
function pager(type,n){
	$("#page-wrapper").load("./"+type+"_info.php",{pager:n});
}
function operate(type,n,pager,operate){
	up();
	$("#box").load("./ajax_box.php",{type:type,id:n,pager:pager,operate:operate});
}
function operate_cancel(type,pager){
	var tab;
	switch(type){
		case 'teacher':
			tab = 1;break;
		case 'student':
			tab = 2;break;
		case 'course':
			tab = 3;break;
		case 'choice':
			tab = 4;break;
		case 'sign':
			tab = 5;break;
		case 'card':
			tab = 6;break;
		case 'date':
			tab = 7;break;
		case 'info':
			tab = 0;break;
		default:
			tab = 8;break;
	}
	nav_switch(tab,pager);
	$('#box_bg').hide();
}
function operate_confirm(type,pager,n,operate){
}